<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Installing Bookmaker Workbench</title>
<style type="text/css">
ol li { padding-top: 20px; }
ul li { padding-top: 0px; }
</style>
</head>
<body>
<h1>Installing Bookmaker Workbench</h1>
<ol>
<li>Bookmaker Workbench utilized the following software:
<ul>
<li><a href="http://httpd.apache.org/download.cgi">Apache 2 HTTP Server</a></li>
<li><a href="http://www.php.net/downloads.php">PHP</a></li>
<li><a href="http://www.perl.org/get.html">Perl</a></li>
<li><a href="http://www.swftools.org/download.html">SWF Tools</a>
<br />For Linux or Macintosh, you may need to install <a href="http://zlib.net">zlib</a>, <a href="http://www.ijg.org/files/">jpeglib</a> and <a href="http://sourceforge.net/projects/freetype/files/freetype2/2.4.4/">freetype</a> libraries before you can install the SWF Tools program.</li>
<li><a href="http://www.foolabs.com/xpdf/download.html">xpdf</a></li>
<li><a href="http://sourceforge.net/projects/ghostscript/files/GPL%20Ghostscript/8.71/">ghostscript</a></li>
<li><a href="http://tidy.sourceforge.net/#binaries">HTML Tidy</a></li>
</ul>
<br />Before you can start making Realistic Books, make sure that you have correctly installed those software. It is recommended that you installed all of them into the same folder, and you have the full permission to read/write/modify/delete/execute files in that folder.
<br />Please view the <a href="install.htm">install.htm</a> file to see how you could install each of those software.
<li>Assuming that you are installing to the <code>/Users/name/RealisticBooks/installed</code> folder</li>
<li>Modify your Apache <code>httpd.conf</code> file in the <code>/Users/name/RealisticBooks/installed/conf</code> folder so that it has the following lines:
<div style="margin-left:40px;padding-bottom:15px;padding-top:10px;"><code>
AddHandler cgi-script .cgi .pl<br />
AddType application/x-httpd-php .php .php3 .php4 .php5<br />
AddType application/x-httpd-php-source .phps<br /><br />
&lt;IfModule dir_module&gt;
<div style="margin-left:40px;">DirectoryIndex index.html index.php</div>
&lt;/IfModule&gt;<br /><br />
ScriptAlias /Bookmaker/cgi-bin/ "/Users/name/RealisticBooks/installed/htdocs/Bookmaker/cgi-bin/"<br />
&lt;Directory "/Users/name/RealisticBooks/installed/htdocs/Bookmaker/cgi-bin"&gt;
<div style="margin-left:40px;">
Allow from all<br />
AllowOverride FileInfo AuthConfig Limit Indexes<br />
Options SymLinksIfOwnerMatch
</div>
&lt;/Directory&gt;<br /><br />
php_value upload_max_filesize 20M<br />
php_value post_max_size 80M<br />
php_value memory_limit 160M<br />
php_value max_execution_time 600<br />
php_value max_input_time 1200</p>
</code></div>
If you are in Linux or Macintosh, check that this line has been inserted
<div style="margin-left:40px;padding-top:10px;padding-bottom:15px;"><code>LoadModule php5_module modules/libphp5.so</code></div>
For Windows, assuming that you installed PHP in <code>C:/Users/name/RealisticBooks/installed</code> folder, check that this line has been inserted
<div style="margin-left:40px;padding-top:10px;"><code>LoadModule php5_module "C:/Users/name/RealisticBooks/installed/php5apache2_2.dll"</code></div>
</li>
<li>Place and extract the <code>Bookmaker.zip</code> file inside <code>/Users/name/RealisticBooks/installed/htdocs</code> folder</li>
<li>Change the file permission for <code>Bookmaker</code> folder and its subfolder, so that everyone can read, write, modify, delete and execute all the content of the Bookmaker folder (in Linux or Macintosh do <code>chmod -R 777 Bookmaker</code>)</li>
<li>If you are in Linux or Macintosh, change the file permission of <code>Bookmaker/cgi-bin/upload.cgi</code> so that everyone can read and execute the file, but only you can modify it (<code>chmod 755 Bookmaker/cgi-bin/upload.cgi</code>)</li>
<li>Edit <code>Bookmaker/Util.php</code> file<br /><br />
<ul>
<li>Specify the full path of the <code>pdf2swf</code> program into the <code>$pdf2swf</code> variable
  <div style="margin-left:40px;padding-top:10px;padding-bottom:15px;"><code>$pdf2swf = "/Users/name/RealisticBooks/installed/bin/pdf2swf";</code></div></li>
  <li>Specify the full path of the <code>swfstrings</code> program into the <code>$swfstring</code> variable
  <div style="margin-left:40px;padding-top:10px;padding-bottom:15px;"><code>$swfstring = "/Users/name/RealisticBooks/installed/bin/swfstrings";</code></div></li>
<li>Specify the full path of the <code>pdftotext</code> program into the <code>$pdftotext</code> variable
<div style="margin-left:40px;padding-top:10px;padding-bottom:15px;"><code>$pdftotext = "/Users/name/RealisticBooks/installed/bin/pdftotext";</code></div></li>
<li>Specify the full path of the <code>ghostscript</code> program into the <code>$ghostscript</code> variable
<div style="margin-left:40px;padding-top:10px;"><code>$ghostscript = "/Users/name/RealisticBooks/installed/bin/gs";</code></div>
<br />The name of the <code>ghostcript</code> program may differ among operating systems. It may not be called <code>gs</code>. For example, <code>gswin32.exe</code> is the name of the <code>ghostscript</code> program for Windows 32-bit computer and the <code>$ghostscript</code> variable becomes:
<div style="margin-left:40px;padding-top:10px;"><code>$ghostscript = "/Users/name/RealisticBooks/installed/bin/gswin32";</code></div>
<p>Please check the ghostscript's <code>README</code> file to know the actual name of the program</p></li>
<li>Specify the full path of the <code>HTML Tidy</code> program into the <code>$tidy</code> variable
<div style="margin-left:40px;padding-top:10px;padding-bottom:15px;"><code>$tidy = "/Users/name/RealisticBooks/installed/bin/tidy";</code></div></li>
<li>Specify the full path to the <code>Bookmaker/bookdir</code> folder into the <code>$uploaddir</code> variable<div style="margin-left:40px;padding-top:10px;padding-bottom:15px;"><code>$uploaddir = "/Users/name/RealisticBooks/installed/htdocs/Bookmaker/bookdir";</code></div></li>		
<li>Specify the full path to the <code>Bookmaker/fontdir</code> folder into the <code>$fontdir</code> variable<div style="margin-left:40px;padding-top:10px;padding-bottom:15px;"><code>$fontdir = "/Users/name/RealisticBooks/installed/htdocs/Bookmaker/fontdir";</code></div></li>
<li>Specify the full path to the <code>Bookmaker/time.log</code> file into the <code>$time_log</code> variable
  <div style="margin-left:40px;padding-top:10px;padding-bottom:15px;"><code>$time_log = "/Users/name/RealisticBooks/installed/htdocs/Bookmaker/time.log";</code></div></li>
<li>If you are behind a proxy server, specify your username, password and proxy address inside the <code>$username, $password</code> and <code>$proxyaddr</code> variables respectively
<div style="margin-left:40px;padding-top:10px;"><code>
$username = "name";<br />
$password = "pwd";<br />
$proxyaddr = "tcp://proxy.scms.waikato.ac.nz:8080";</code></div></li>
</ul>
</li>
<li>Edit <code>Bookmaker/cgi-bin/upload.cgi</code> file<br /><br />
<ul>
<li>Change the first line of the file so that it points to the location of your <code>perl</code> program
<div style="margin-left:40px;padding-top:10px;padding-bottom:15px;"><code>#!/Users/name/RealisticBooks/installed/bin/perl -w</code></div></li>
<li>Specify the full path to the <code>Bookmaker/bookdir</code> folder into the <code>$uploaddir</code> variable
  <div style="margin-left:40px;padding-top:10px;padding-bottom:15px;"><code>my $uploaddir = "/Users/name/RealisticBooks/installed/htdocs/Bookmaker/bookdir";</code></div></li>
<li>Specify the full path to the <code>Bookmaker/ExampleBooks</code> folder into the <code>$sourcedir</code> variable
  <div style="margin-left:40px;padding-top:10px;"><code>my $sourcedir = "/Users/name/RealisticBooks/installed/htdocs/Bookmaker/ExampleBooks";</code></div></li>
</ul>
</li>
<li>Now you are ready to create your own Realistic Books. Assuming that your local Apache web server can be accessed from <code>http://localhost:8080</code>, you can access the Bookmaker Workbench from <code>http://localhost:8080/Bookmaker</code></li>
<ul>
<li>Enter the name of your book</li>
<li>If you want Realistic Books to build an automatic back-of-the-book index, automatically detect and link key phrases to a Wikipedia article, and search over synonyms, tick the <code>Find keyphrase in <i>book.htm</i> and link it to Wikipedia option</code>.</li>
<li>By default, Realistic Books will convert each page of your PDF file into a <code>swf</code> file which is a vector graphic format. However, if you tick the <code>Most pages in the book are bitmap images</code> option, each page of your PDF file will be converted into a <code>png</code> file which is a bitmap images. In some cases, selecting this option produce more readable books.</li>
<li>Click the <code>Upload file ...</code> button, and select the PDF file you want to upload</li>
<li>Once you finished setting the book, click the <code>Save</code> button</li>
<li>Assuming that you named your book <code>testingbook</code>, you can view your book from <code>http://localhost:8080/Bookmaker/bookdir/testingbook</code>
</ul>
</ol>
<p>If you have any questions or suggestions, please do not hesitate to e-mail Veronica at vl6@cs.waikato.ac.nz</p>
</body>
</html>
